// JavaScript Document
$(document).ready(function() {
	var winH = $(window).height();
	$(".app_content").css("height",(winH-175)+"px");
	var loginFormH = $(".login_box").height() - 33;
	$(".login_form_right_bg").css("height",loginFormH+"px");
	$(".login_form_left_bg").css("height",loginFormH+"px");
	$(".form_area").css("height",loginFormH+"px");
	var appPanelH = winH - 175;
	$(".app_panel_pos_s").css("height",appPanelH+"px");
	var appScollH = $(".right_side_details").height() - $(".right_side_operate_area").height();
	$(".right_side_scollbar").css("height",appScollH+"px");
	var timeLineW = $("#timeline").width();
	$("#issues li").css("width",timeLineW+"px");
	$("#issue_panel_arrow").css("left",(timeLineW/2-9)+"px");
	$(".time_line_panel").css("width",timeLineW+"px");
	$(window).resize(function() {
		winH = $(window).height();
		$(".app_content").css("height",(winH-175)+"px");
		loginFormH = $(".login_box").height() - 33;
		$(".login_form_right_bg").css("height",loginFormH+"px");
		$(".login_form_left_bg").css("height",loginFormH+"px");
		$(".form_area").css("height",loginFormH+"px");
		appPanelH = winH - 175;
		$(".app_panel_pos_s").css("height",appPanelH+"px");
		appScollH = $(".right_side_details").height() - $(".right_side_operate_area").height();
		$(".right_side_scollbar").css("height",appScollH+"px");
		timeLineW = $("#timeline").width();
		$("#issues li").css("width",timeLineW+"px");
		$("#issue_panel_arrow").css("left",(timeLineW/2-9)+"px");
		$(".time_line_panel").css("width",timeLineW+"px");
	});
	$(".manage_user_toggle").click(function(){
		if($('.manage_user_panel').css("display")=='none'){
			$(this).html("取消添加");
		}else{
			$(this).html("添加成员");
		}$(".manage_user_panel").slideToggle("slow");
	});
	$(".function_seperate").click(function(){
		$(".file_panel").slideToggle("slow");
		$(".function_seperate").toggleClass("active");
	});
	$(".left_side_menu_panel ul li a").next().prev().addClass("submenuArrow");
});
function click_drop_menu(hasSubMenu) {
	$(hasSubMenu).next().slideToggle("fast");
	$(hasSubMenu).toggleClass("active");
}
function showsubmenu(str,strlist){
	
	var has_sec_level = $("."+str), sec_level_directory = $("#"+strlist);
	
	has_sec_level.find("a").hover(function(e){
		
		e.stopPropagation();
		var secLevelOffset = $("."+str).position();
//		sec_level_directory.show();
//		sec_level_directory.offset({left: secLevelOffset.left + $(this).outerWidth(), top: secLevelOffset.top});
		sec_level_directory.css({top: secLevelOffset.top+"px"});
		sec_level_directory.animate({
			opacity: 'show'
		},100);
	}, function(e){
		e.stopPropagation();
		sec_level_directory.hover(function(){ 
			$(this).show();
		},function(){
//			$(this).hide();
			$(this).animate({
				opacity: 'hide'
			},100);
		});
		sec_level_directory.hide();
//		sec_level_directory.animate({
//			opacity: 'hide'
//		},500);
	});
}
//showsubmenu('technology','technologyIndex');
//showsubmenu('rentbonus','RentbonusIndex');
//showsubmenu('persondb','persondblist');
//showsubmenu('leaseinformation','LeaseIndex');
function G(id){
	return document.getElementById(id);
}
window.onunload=function(){};
function searchinfo(id){
	var webpath=$("#getpath").attr('href');
	var keyword="";
	if(id){
		keyword=$("#"+id).val();
	}else{
		keyword=$("#search").val();
	}
	if(keyword.trim()!=""){
		var path=$("#gcontroller").html()+"/"+$("#gaction").html()
		var urlpath=webpath+path.toLocaleLowerCase()+"?keyword="+encodeURIComponent(keyword.trim());
		location.href=urlpath;
	}
	return false;
}